<template>
  <a-card :bordered='false'>
    <search :config='searchConfig' @search='search' @getHeight='getHeight' />
    <div class='table-operator'>
      <a-button @click='handleAdd' type='primary'>新增</a-button>
      <a-button @click='handleAdd' type='primary'>删除</a-button>
      <a-button @click='handleAdd' type='primary'>导出</a-button>
      <a-button @click='handleAdd' type='primary'>同步</a-button>
    </div>
    <a-table
      ref='table'
      size='middle'
      bordered
      rowKey='id'
      :columns='columns'
      :dataSource='dataSource'
      :pagination='ipagination'
      :loading='loading'
      :scroll='{x:1000,y:pageHeight-seachHeight-220}'
      :customRow='onClickRow'
      :rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}'
      @change='handleTableChange'>
      <span slot="customTitle"><a-icon type="smile-o" /> Name</span>
      <template slot='status' slot-scope='t,r'>
     启用
      </template>
      <span slot='action' slot-scope='text, record'>
          <a @click='handleEdit(record)'>编辑</a>
        <!--          <a-divider type="vertical" />-->
           <a-popconfirm title='确定删除吗?' @confirm='() => handleDelete(record.id)'>
<!--            <a>删除</a>-->
          </a-popconfirm>
        </span>
    </a-table>
    <contactManaModal ref="modalForm" @ok="modalFormOk"></contactManaModal>
  </a-card>
</template>

<script>

import contactManaModal from './modules/ContactManaModal.vue'
import { PageListMixin } from '@/mixins/PageListMixin'
export default {
  name: 'contactMana',
  mixins:[PageListMixin],
  components:{
    contactManaModal,
  },
  data() {
    return {
      description: '收货地址',
      searchConfig: [
        {
          type: 'input',
          name: 'businessKey',
          placeholder: '内部经销商编号'
        },
        {
          type: 'input',
          name: 'businessKey',
          placeholder: '内部经销商名称'
        },
        {
          type: 'input',
          name: 'businessKey',
          placeholder: '内部经销商类型'
        },
        {
          type: 'input',
          name: 'businessKey',
          placeholder: '组织机构'
        },
        {
          type: 'j-select',
          name: 'businessKey',
          dictCode:'yesOrno',
          placeholder: '状态',
        },
        {
          type: 'input',
          name: 'businessKey',
          placeholder: '流程状态'
        },
      ],
      columns: [
        {
          title: '经销商编号',
          align: 'left',
          dataIndex: 'terminalCodess',
          ellipsis: true,
          width: 150,
        },
        {
          title: '经销商名称',
          align: 'left',
          width: 120,
          dataIndex: 'terminalCode',
          ellipsis: true
        },
        {
          title: '用户账号',
          align: 'left',
          width: 120,
          dataIndex: 'terminalCode',
          ellipsis: true
        },
        {
          title: '用户名称',
          align: 'left',
          width: 120,
          dataIndex: 'terminalCode',
          ellipsis: true
        },
        {
          title: '业务类型',
          align: 'left',
          width: 120,
          dataIndex: 'terminalCode',
          ellipsis: true
        },
        {
          title: '备注',
          align: 'left',
          width: 120,
          dataIndex: 'terminalCode',
          ellipsis: true
        },
        {
          title: '创建人',
          align: 'left',
          width: 120,
          dataIndex: 'terminalCode',
          ellipsis: true
        },
        {
          title: '创建时间',
          align: 'left',
          width: 120,
          dataIndex: 'terminalCode',
          ellipsis: true
        },
        {
          title: '更新人',
          align: 'left',
          width: 120,
          dataIndex: 'terminalCode',
          ellipsis: true
        },
        {
          title: '更新时间',
          align: 'left',
          width: 120,
          dataIndex: 'terminalCode',
          ellipsis: true
        },
        {
          fixed: 'right',
          title: '状态',
          align: 'center',
          width: 120,
          slots: { title: 'customTitle' },
          scopedSlots: { customRender: 'status' },
          ellipsis: true,
        },
        {
          fixed: 'right',
          title: '操作',
          align: 'center',
          width: 120,
          scopedSlots: { customRender: 'action' },
          ellipsis: true
        }
      ],
      dataSource:[
        {
          id:'55',
          terminalCode:'9999999999999999999999999999999999999999',
          terminalCodess:'eeee9999999999999999999999999999999999999999eeee'
        }
      ],
      tabelUrl: window._CONFIG['domianURL'] + "/cnUserController/getPageList",
    }
  },
  created(){

  },
  methods:{
    search(queryParam, butType) {
      this.selectedRowKeys = []
      this.selectionRows = []
      this.queryParam = queryParam
      this.$refs.tableList.loadListData(queryParam)
    },
  }
}
</script>

<style scoped>
@import '~@assets/less/common.less';
</style>